package com.unionServer.common;

/**
 * @description:
 * @author: wangxinal
 * @time: 2022/1/19 10:11
 */
public class ATMPINConverter {
    public ATMPINConverter() {
    }

    public byte[] getFromBcd(byte[] arg0) {
        int len = arg0.length;
        StringBuffer sb = new StringBuffer(len * 2);

        for(int i = 0; i < len; ++i) {
            String temp = Integer.toHexString(255 & arg0[i]);
            if (temp.length() < 2) {
                sb.append(0);
            }

            sb.append(temp.toUpperCase());
        }

        return sb.toString().getBytes();
    }
}
